package no.uib.kwikktaim.gui;

import java.awt.BorderLayout;

import javax.swing.BorderFactory;
import javax.swing.JDialog;
import javax.swing.JLabel;
import no.uib.kwikktaim.core.FrameHandler;

/**
 * Show a "please wait" while we calculating keyframes
 */
public class GeneratingKeyframesDialog {

	dialogen d;

	/**
	 * The window
	 */
	class dialogen extends JDialog {
		JLabel information;
		public dialogen() {
			this.setLayout(new BorderLayout());

			information = new JLabel("Generating Keyframes...");
			information.setBorder(BorderFactory.createEmptyBorder(20, 60, 20, 60));
			this.add(information, BorderLayout.CENTER);

			this.isResizable();
			this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
			this.pack();

			FrameHandler.centerScreen(this);
			this.setVisible(true);
		}
		public void setInfo(String info) {
			information = new JLabel(info);
		}

	}

	public GeneratingKeyframesDialog() {
		d = new dialogen();
		d.setVisible(true);
	}

	/**
	 * Hides the dialog
	 */
	public void removeDialog() {
		d.setVisible(false);
		d = null;
	}

}

